package cn.iocoder.an.module.business.dal.mysql.equipmenttype;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.equipmenttype.EquipmentTypeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.equipmenttype.vo.*;

/**
 * 设备分类 Mapper
 *
 * @author zzy
 */
@Mapper
public interface EquipmentTypeMapper extends BaseMapperX<EquipmentTypeDO> {

    default PageResult<EquipmentTypeDO> selectPage(EquipmentTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EquipmentTypeDO>()
                .likeIfPresent(EquipmentTypeDO::getName, reqVO.getName())
                .eqIfPresent(EquipmentTypeDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(EquipmentTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EquipmentTypeDO::getId));
    }

}